1
//------------------------------------------------------------------------------
3 // This code was generated by a tool.
5 // Changes to this file may cause incorrect behavior and will be lost if
6 // the code is regenerated.
8 //------------------------------------------------------------------------------
10 using VSShellInterop
= global::Microsoft
.VisualStudio
.Shell
.Interop
;
11 using VSShell
= global::Microsoft
.VisualStudio
.Shell
;
12 using DslShell
= global::Microsoft
.VisualStudio
.Modeling
.Shell
;
13 using DslDesign
= global::Microsoft
.VisualStudio
.Modeling
.Design
;
14 using DslModeling
= global::Microsoft
.VisualStudio
.Modeling
;
15 using VSTextTemplatingHost
= global::Microsoft
.VisualStudio
.TextTemplating
.VSHost
;
17 using System
.Diagnostics
;
18 using System
.Drawing
.Design
;
20 using System
.Windows
.Forms
;
22 namespace Fabrikam
.Dsl
.TestValidation
25 /// This class implements the VS package that integrates this DSL into Visual Studio.
27 [VSShell
::DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\10.0")]
28 [VSShell
::PackageRegistration(RegisterUsing
= VSShell
::RegistrationMethod
.Assembly
, UseManagedResourcesOnly
= true)]
29 [VSShell
::ProvideToolWindow(typeof(TestValidationExplorerToolWindow
), MultiInstances
= false, Style
= VSShell
::VsDockStyle
.Tabbed
, Orientation
= VSShell
::ToolWindowOrientation
.Right
, Window
= "{3AE79031-E1BC-11D0-8F78-00A0C9110057}")]
30 [VSShell
::ProvideToolWindowVisibility(typeof(TestValidationExplorerToolWindow
), Constants
.TestValidationEditorFactoryId
)]
31 [VSShell
::ProvideStaticToolboxGroup("@TestValidationToolboxTab;Company.Language2.Dsl.dll", "Fabrikam.Dsl.TestValidation.TestValidationToolboxTab")]
32 [VSShell
::ProvideStaticToolboxItem("Fabrikam.Dsl.TestValidation.TestValidationToolboxTab",
33 "@PersonToolboxItem;Company.Language2.Dsl.dll",
34 "Fabrikam.Dsl.TestValidation.PersonToolboxItem",
35 "CF_TOOLBOXITEMCONTAINER,CF_TOOLBOXITEMCONTAINER_HASH,CF_TOOLBOXITEMCONTAINER_CONTENTS",
36 "ConnectPersonF1Keyword",
37 "@PersonToolboxBitmap;Company.Language2.Dsl.dll",
39 [VSShell
::ProvideStaticToolboxItem("Fabrikam.Dsl.TestValidation.TestValidationToolboxTab",
40 "@ParentRelationToolboxItem;Company.Language2.Dsl.dll",
41 "Fabrikam.Dsl.TestValidation.ParentRelationToolboxItem",
42 "CF_TOOLBOXITEMCONTAINER,CF_TOOLBOXITEMCONTAINER_HASH,CF_TOOLBOXITEMCONTAINER_CONTENTS",
43 "ConnectParentRelationF1Keyword",
44 "@ParentRelationToolboxBitmap;Company.Language2.Dsl.dll",
46 [VSShell
::ProvideEditorFactory(typeof(TestValidationEditorFactory
), 103, TrustLevel
= VSShellInterop
::__VSEDITORTRUSTLEVEL
.ETL_AlwaysTrusted
)]
47 [VSShell
::ProvideEditorExtension(typeof(TestValidationEditorFactory
), "." + Constants
.DesignerFileExtension
, 50)]
48 [DslShell
::ProvideRelatedFile("." + Constants
.DesignerFileExtension
, Constants
.DefaultDiagramExtension
,
49 ProjectSystem
= DslShell
::ProvideRelatedFileAttribute
.CSharpProjectGuid
,
50 FileOptions
= DslShell
::RelatedFileType
.FileName
)]
51 [DslShell
::ProvideRelatedFile("." + Constants
.DesignerFileExtension
, Constants
.DefaultDiagramExtension
,
52 ProjectSystem
= DslShell
::ProvideRelatedFileAttribute
.VisualBasicProjectGuid
,
53 FileOptions
= DslShell
::RelatedFileType
.FileName
)]
54 [DslShell
::RegisterAsDslToolsEditor
]
55 [global::System
.Runtime
.InteropServices
.ComVisible(true)]
56 [DslShell
::ProvideBindingPath
]
57 [DslShell
::ProvideXmlEditorChooserBlockSxSWithXmlEditor(@"TestValidation", typeof(TestValidationEditorFactory
))]
58 internal abstract partial class TestValidationPackageBase
: DslShell
::ModelingPackage
60 protected global::Fabrikam
.Dsl
.TestValidation
.TestValidationToolboxHelper toolboxHelper
;
63 /// Initialization method called by the package base class when this package is loaded.
65 protected override void Initialize()
69 // Register the editor factory used to create the DSL editor.
70 this.RegisterEditorFactory(new TestValidationEditorFactory(this));
72 // Initialize the toolbox helper
73 toolboxHelper
= new global::Fabrikam
.Dsl
.TestValidation
.TestValidationToolboxHelper(this);
75 // Create the command set that handles menu commands provided by this package.
76 TestValidationCommandSet commandSet
= new TestValidationCommandSet(this);
77 commandSet
.Initialize();
79 // Register the model explorer tool window for this DSL.
80 this.AddToolWindow(typeof(TestValidationExplorerToolWindow
));
82 // Initialize Extension Registars
83 // this is a partial method call
84 this.InitializeExtensions();
86 // Add dynamic toolbox items
87 this.SetupDynamicToolbox();
91 /// Partial method to initialize ExtensionRegistrars (if any) in the DslPackage
93 partial void InitializeExtensions();
96 /// Returns any dynamic tool items for the designer
98 /// <remarks>The default implementation is to return the list of items from the generated toolbox helper.</remarks>
99 protected override global::System
.Collections
.Generic
.IList
<DslDesign
::ModelingToolboxItem
> CreateToolboxItems()
103 Debug
.Assert(toolboxHelper
!= null, "Toolbox helper is not initialized");
104 return toolboxHelper
.CreateToolboxItems();
106 catch(global::System
.Exception e
)
108 global::System
.Diagnostics
.Debug
.Fail("Exception thrown during toolbox item creation. This may result in Package Load Failure:\r\n\r\n" + e
);
115 /// Given a toolbox item "unique ID" and a data format identifier, returns the content of
118 /// <param name="itemId">The unique ToolboxItem to retrieve data for</param>
119 /// <param name="format">The desired format of the resulting data</param>
120 protected override object GetToolboxItemData(string itemId
, DataFormats
.Format format
)
122 Debug
.Assert(toolboxHelper
!= null, "Toolbox helper is not initialized");
124 // Retrieve the specified ToolboxItem from the DSL
125 return toolboxHelper
.GetToolboxItemData(itemId
, format
);
132 // Package attributes which may need to change are placed on the partial class below, rather than in the main include file.
134 namespace Fabrikam
.Dsl
.TestValidation
137 /// Double-derived class to allow easier code customization.
139 [VSShell
::ProvideMenuResource("1000.ctmenu", 1)]
140 [VSShell
::ProvideToolboxItems(1)]
141 [VSTextTemplatingHost
::ProvideDirectiveProcessor(typeof(global::Fabrikam
.Dsl
.TestValidation
.TestValidationDirectiveProcessor
), global::Fabrikam
.Dsl
.TestValidation
.TestValidationDirectiveProcessor
.TestValidationDirectiveProcessorName
, "A directive processor that provides access to TestValidation files")]
142 [global::System
.Runtime
.InteropServices
.Guid(Constants
.TestValidationPackageId
)]
143 internal sealed partial class TestValidationPackage
: TestValidationPackageBase